#ifndef __DRV_CAN_H__
#define __DRV_CAN_H__

#include <stdint.h>
#include "stm32f4xx.h"                  // Device header

typedef struct
{
  int16_t mechanical_angle;  // 机械角度
  int16_t speed;             // 转速
  int16_t torque_current;    // 实际转矩电流
  uint8_t temperature;       // 电机温度
}MotorData_t;

void CAN_Init(void);//can初始化
void CAN_Send(uint8_t *message);//can发送函数
void CAN_Receive(uint32_t *ID, uint8_t *Length, uint8_t *Data);
void ExtractMotorData(uint8_t *RxData, MotorData_t *motor_data);

#endif
